Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for gride size and position #250

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

l-monnier
Copy link

Hello,

Following our discussions in issue 176, here is my pull request for Grid size and position support.
I've also performed some minor corrections to avoid GHC compiler warnings and compilation failures with older version of GHC.

Some notes:

  • I've implemented a '//' operator for the CSS '/' operator. However, this operator is used in other CSS properties (background and font are the ones I know of). So, it's not fully coherent with the rest of the library. On the other hand, I find the syntax rather nice and natural (more than using tuples, especially because I already use them when a custom-ident is combined with an Integer).
  • There are spaces between the the '/' and its parameters (1 / 2) which is not removed when rendered in compact form. However, I feel this should more be the job of the compact rendering to remove them (but maybe I'm missing something here)
  • To properly implement all the naming rules for the custom-ident is highly complex due to the escaping and Unicode rules. It would require a parser such as MegaParsec. RegExp would not really be a good solution, as it would be difficult to return valuable error messages to the user. Adding a dependency for this only purpose is not worth it in my opinion.

Let me know your thoughts.

leo added 20 commits February 28, 2023 22:22
First draft to support the following CSS properties:
grid-row-start, grid-row-end, grid-column-start, grid-column-end,
grid-row, grid-column and grid-area.
Add a `4` at the end of such data types and functions for more
consistency.
This avoids a warning from the compiler.
Use of folding headings to make the documentation more compact.
Added a Example heading. There is unfortunately a bug with Haddock
when trying to make the heading foldable.
This will allow a more finer control grain over the types and
there documentation.
The checks are for the moment only when the custom-ident is
created as a 'CustomIdent' type.
As long as there are no function implementing Either instead
of the partial functions, there is a risk for invalid value being
built by the user. Also we could later change the interface of
those functions/constructors so they return an Either value.
Errors are now raised when invalid custom-ident are provided,
regardless if they are provided as a String or as a CustomIdentGrid.
The compilation error is with older version of GHC when compiling
with Nix.
Comments of arguments where not properly formatted and lead to a
compilation failure for older version of GHC when testing the build
with Nix.
@CharlesTaylor7 CharlesTaylor7 mentioned this pull request Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant